﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using HZ.MBSM.DBUtility;
public partial class Bidder_Goods_details : System.Web.UI.Page
{
    public Int32 PJID;
    Int64 AccountId_TBR, Accountid_sc;
    string productname;


    protected void Page_Load(object sender, EventArgs e)
    {
        HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
        if (_Account != null)
        {
            if (!IsPostBack)
            {
                string sql = "";
                string BPNUM = "0";
                System.Data.IDataReader dr;
                AccountId_TBR = SysFun.ToLong(_Account.AccountId);
                PJID = SysFun.ToInt(SysFun.IsSQL(Request.QueryString["ProjectId"]));
                Accountid_sc = SysFun.ToLong(SysFun.IsSQL(Request.QueryString["sc"]));
                productname = MsgBox.JieMi_Decrypt(Request.QueryString["productname"].Trim());
                showGrid();
            }



        }
        else
        {
            Response.Write("<script>window.alert('对不起，请重新登录！');</script>");
            Response.Write("<script>window.location.href='../HomePage/Default.aspx';</script>");
        }

    }
    protected void showGrid()
    {
        
        Db db = new Db();
        string sql = @"SELECT  goodsid as 流水号, Productname as 通用名,medicinemodel as 剂型 ,outlookc as 规格,unit as 单位,xishu as 转换系数 FROM v_product_goods ,bid_project_Product where bid_project_Product.productid=v_product_goods.productid and (ifbid <>0 or ifbid is null)";
        sql += " and projectid=" + PJID.ToString() + " and Accountid_SC=" + Accountid_sc + " and Productname ='"+productname +"'";
        
        System.Data.IDataReader dr = db.DataReader(sql);
        GridView1.DataSource = dr;
        GridView1.DataBind();
       
        dr.Close();
        dr.Dispose();
        db.Close();
    }
   
    
}
